#include <QApplication>
#include <QMessageBox>
/*#include <qsqldatabase.h>
#include <QWidget>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QVariant>*/
#include <QLabel>
//#include "weight.h"
#include "User.h"
#include "DbSession.h"
#include <QDebug>

int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    QLabel lbl;
    lbl.resize(200,200);

    DbSession dbs; // = new DbSession();


//dbs->getWeights(3);
//qDebug()<<dbs->getUser(3)->getWeights()->back()->getDate();
//dbs->getAllUsers();
//qDebug()<< dbs.getFitnessPlan(3)->getFitnessComments()->back()->getDate();
//qDebug()<< dbs.getDietPlan(1)->getDietComments()->back()->getDate();
//dbs.addDietComment(1,1,"Good!");
//dbs.addFitnessComment(1,1,"Good!");
//dbs->getWeights(3);
//qDebug()<<dbs->getUser(3)->getWeights()->back()->getDate();

 //   dbs.addWeight(3, 60);
  //  dbs.addDietPlan(3, "I will eat 0,5 kg apples");
 //   dbs.addFitnessPlan(1, "I'm going to play basketball 3 times a week");

//if (dbs->registerUser("nnnn","test"))
//{
//    qDebug()<<"Added!";
//}
////dbs->getAllUsers();

lbl.setText("Test programm is working!");
lbl.show();
//int userId = dbs.getUserIdByToken("iiiiiiiiii");
//qDebug() << "test: " << dbs.getUser(userId)->getWeights()->last()->getWeight();
//dbs.addDietPlan(1,"test1 add");
//dbs.editDietPlan(1,"test2 edit");
//dbs.addFitnessPlan(1,"test1 add");
//dbs.editFitnessPlan(1, "test1 edit");
qDebug() << dbs.getFitnessPlan(1)->at(0)->getInfo();
    return app.exec();
}
